package com.example.base;

import com.example.util.CommonUtils;

import java.util.concurrent.CompletableFuture;

public class RunAsyncDemo {
    public static void main(String[] args) {
        CommonUtils.printThreadLog("main start");

        CompletableFuture.runAsync(() -> {
            CommonUtils.printThreadLog("读文件，开始");
            CommonUtils.sleepSecond(3);
            CommonUtils.printThreadLog("读文件，结束");
        });

        CommonUtils.printThreadLog("main continue");
        CommonUtils.sleepSecond(5);
        CommonUtils.printThreadLog("main end");
    }
}
